package com.yida.gwj.expend.enums;

import com.yida.gwj.common.enums.FileTypeEnum;

/**
 * 附件类型枚举
 *
 * @author liangp
 * @date 2023/02/24
 */
public enum BusinessAttachmentTypeEnum {
    /**
     * 附件类型
     */
    PICTURE(1, "图片"),
    REPORT(2, "报告"),
    FILE(3, "文件"),
    ALTIMETER(4, "高拍仪"),
    ;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    BusinessAttachmentTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 状态码
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String msg;

    public static BusinessAttachmentTypeEnum transfer(String value) {
        switch (FileTypeEnum.transform(value)) {
            case JPG:
            case JPEG:
            case PNG:
                return PICTURE;
            default:
                return FILE;
        }
    }
}
